<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<input type="file" class="im_hidden" onchange="ajaxImgUpload('http://127.0.0.1:8080/fileUpload','info_file')" name="info_file" id="info_file"  />
<br>
<input type='button' value='请求' onclick='topost()'>
</body>
<script src="jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
<script src="ajaxfileupload.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
//图片上传
function ajaxImgUpload(picUrl, param) {
    var fileName = $("#" + param).val().substring($("#" + param).val().lastIndexOf("\\") + 1);
    var fileType = fileName.substring(fileName.lastIndexOf(".") + 1);
    ;
    if (fileType != "png") {
        alert("请上传png文件！");
        $("#" + param).val("");
    } else {
        $.ajaxFileUpload({
            url: picUrl, //服务器地址
            fileElementId: param, //文件的id属性
            dataType: 'text', //服务器返回的格式
            success: function (data, status) { //try语句块
                console.log(data);
            }, error: function (data, status, e) { // 相当于java中catch语句块的用法
                alert(e);
                alert("上传文件时出错，请联系管理员");
            }
        });
    }
}

function topost(){
	$.post("delSysuserByIds",
    		{
    		},function(data,status){
    			console.log(data);
    			
    	});
}

</script>
</html>